﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LdtJudge.DataEngine.Model.ElmentModel
{
    /// <summary>
    /// 要素配置对象
    /// </summary>
    [Serializable]
    public class ElementConfigModel
    {
        /// <summary>
        /// 选择类型
        /// </summary>
        public string checkType;
        /// <summary>
        /// 参数类型
        /// </summary>
        public string sourceType;
        /// <summary>
        ///参数内容
        /// </summary>
        public string sourceContent;
        /// <summary>
        /// 默认值
        /// </summary>
        public string defaultValue;

        public int isSerialField;
        /// <summary>
        /// 值类型
        /// </summary>
        public string fieldType;
        /// <summary>
        /// 格式化类型
        /// </summary>
        public string formatType;
        /// <summary>
        /// 是否人员节点
        /// </summary>
        public int isPersonNode = 0;
        /// <summary>
        /// 诉讼地位
        /// </summary>
        public string suitDegreeID;
        /// <summary>
        /// 人员匹配模式
        /// 提取匹配:extract;自动匹配:autoMatch;减匹配:minusExtract;
        /// </summary>
        public string matchPersonMode;
        /// <summary>
        /// 人员匹配条件
        /// ni_sex|t1$sp_participanttypeid|t1
        /// </summary>
        public string matchPersonCondi;
        /// <summary>
        /// 是否单独进行提取
        /// </summary>
        public int isAloneExtract;
        /// <summary>
        /// 是否多行提取
        /// </summary>
        public int isMultiExact;
        /// <summary>
        /// 要素节点
        /// </summary>
        public string XmlPath;
        /// <summary>
        /// 原告
        /// 2016-11-21 fyb 用于推原告
        /// </summary>
        public int plainTiff;

        /// <summary>
        /// 父级属性条件
        /// </summary>
        public string parentnode;

        private static ElementConfigModel _defaultElementConfig;
        /// <summary>
        /// 获取默认实例对象
        /// </summary>
        /// <returns></returns>
        public static ElementConfigModel GetDefaultStance()
        {
            if (_defaultElementConfig == null)
            {
                _defaultElementConfig = new ElementConfigModel();
                _defaultElementConfig.checkType = "radio";
                _defaultElementConfig.sourceType = "";
                _defaultElementConfig.sourceContent = "";
                _defaultElementConfig.defaultValue = "";
                _defaultElementConfig.fieldType = "varchar";
                _defaultElementConfig.isSerialField = 0;
                _defaultElementConfig.formatType = "";
                _defaultElementConfig.isPersonNode = 0;
                _defaultElementConfig.suitDegreeID = "";
                _defaultElementConfig.matchPersonMode = "extract";      //默认为提取匹配
                _defaultElementConfig.matchPersonCondi = "";
                _defaultElementConfig.isAloneExtract = 0;
                _defaultElementConfig.isMultiExact = 0;
            }
            return _defaultElementConfig;
        }
        /// <summary>
        /// 1为element节点2为node
        /// </summary>
        public string isNodeByAtticton { get; set; }

        /// <summary>
        /// 属性值内容
        /// </summary>
        private Dictionary<string, string> _DictionaryAttribute = new Dictionary<string, string>();

        /// <summary>
        /// 属性值添加
        /// </summary>
        public Dictionary<string, string> DictionaryAttribute
        {
            get { return _DictionaryAttribute; }
            set { _DictionaryAttribute = value; }

        }

    }
}
